<?php
/**
 * Created by PhpStorm.
 * User: R.Ice
 * Date: 2019/1/10
 * Time: 11:29
 * name:新增记账记录
 * url:/erpEnterpriseStructure/add_bookkeeping_record
 */

$obr_prise      = $route->bodyParams['obr_prise'];                              //记账金额
$obr_type       = $route->bodyParams['obr_type'];                               //记账类型 0-支出 1-收入
$obr_action_time= $route->bodyParams['obr_action_time'];                         //发生时间
$obr_fee_detail = $route->bodyParams['obr_fee_detail'];                         //费用明细
$obr_department = $route->bodyParams['obr_department'];                         //所属部门
$obr_bookkeeping_mode_id = $route->bodyParams['obr_bookkeeping_mode_id'];       //记账类型id 1固定费用 2营销成本 3日常费用 4学具耗材 5工资支出
$obr_bookkeeping_mode_str = $route->bodyParams['obr_bookkeeping_mode_str'];                //记账类型字符串
$obr_oesid = $route->bodyParams['obr_oesid'];                //记账类型字符串
$obr_image      = $regexpObj->bodyV($response,$route,'obr_image','NORMAL');                //图片，以“|”隔开
$obr_discount_years  = $regexpObj->bodyV($response,$route,'obr_discount_years','NORMAL');  //残值年限
$obr_discount_surplus_prise  = $regexpObj->bodyV($response,$route,'obr_discount_surplus_prise','NORMAL');    //录入时间
$obr_ofdid  = $regexpObj->bodyV($response,$route,'obr_ofdid','NORMAL');    //录入时间
//写入数组
$insertArr = [
    'obr_prise'      => $obr_prise,
    'obr_type'       => $obr_type,
    'obr_action_time'=> $obr_action_time,
    'obr_fee_detail' => $obr_fee_detail,
    'obr_department' => $obr_department,
    'obr_image'      => $obr_image,
    'obr_discount_years'         => $obr_discount_years,
    'obr_discount_surplus_prise' => $obr_discount_surplus_prise,
    'obr_bookkeeping_mode_id' => $obr_bookkeeping_mode_id,
    'obr_bookkeeping_mode_str' => $obr_bookkeeping_mode_str,
    'obr_oesid' => $obr_oesid,
    'obr_create_time'            =>time(),
    'obr_ofdid'            =>$obr_ofdid,
];
//执行写入语句
$rsData = $db->mysqlDB->insert("oa_bookkeeping_record",$insertArr);

//返回成功结果
$response->responseData( true, $rsData );